const mongoose = require("mongoose");

const TimeLineSchema = mongoose.Schema({
  date: String,
  date_ts: {
    type: Number,
    required: true,
    unique: true,
  },
  episodes: {
    type: [
      {
        cover: String,
        delay: Number,
        delay_id: Number,
        delay_index: String,
        delay_reason: String,
        enable_vt: Boolean,
        ep_cover: String,
        episode_id: Number,
        follows: String,
        plays: String,
        pub_index: String,
        pub_time: String,
        pub_ts: Number,
        published: Number,
        season_id: Number,
        square_cover: String,
        title: String,
      },
    ],
    default: undefined,
  },
  day_of_week: {
    type: Number,
    default: 1,
  },
  is_today: {
    type: Number,
    default: 0,
  },
});

const TimeLine = mongoose.model("TimeLine", TimeLineSchema);

module.exports = TimeLine;
